<html>
<head>
    <title>登录</title>
    <link href="/static/index/css/login.css" rel="stylesheet" type="text/css" media="all"/>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <meta name="keywords" content="后台登录"/>
    <script src="/static/index/js/jquery-1.8.3.min.js"></script>
    <script>
        $(function () {
            $('#doSub').click(function () {
                var userName = $('#userName').val();
                var userPass = $('#userPass').val();
                $.post('/index/login/doLogin',
                    {userName: userName, userPass: userPass},
                    function (data) {
                        if (data.status == 200) {
                            console.log(data.data);
                            window.location.href='/index/index/index';
                        } else {
                            alert(data.data);
                        }
                    }
                );
            });
        });
    </script>
</head>
<body>
<!--header start here-->
<div class="login-form">
    <div class="top-login">
        <span><img src="/static/index/images/group.png" alt=""/></span>
    </div>
    <h1>登录</h1>
    <div class="login-top">
        <form>
            <div class="login-ic">
                <i></i>
                <input type="text" value="admin" id="userName" name="userPass"/>
                <div class="clear"></div>
            </div>
            <div class="login-ic">
                <i class="icon"></i>
                <input type="password" value="123456" id="userPass" name="userPass"/>
                <div class="clear"></div>
            </div>

            <div class="log-bwn">
                <input type="button" value="登录" id="doSub">
            </div>
        </form>
    </div>
    <p class="copy">© 2020 示例项目</p>
</div>
</body>
</html>